

************************************************
********** Synthetic Control Method ************
************************************************

use MoM.dta

************************************************
****** Brazilian Embassies Synth BRAZIL ********
************************************************

ssc install synth, replace all  

xtset ccode year

** synthetic Brazil

synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(140) trperiod(2003) xperiod(1990(1)2002) nested fig


************************************************
****** Brazilian Embassies Synth PLACEBOS ******
************************************************

xtset ccode year 

**** STEP 1: predict all placebos ***************

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(2) trperiod(2003) xperiod(1990(1)2002) keep(synth_2, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(20) trperiod(2003) xperiod(1990(1)2002) keep(synth_20, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(160) trperiod(2003) xperiod(1990(1)2002) keep(synth_160, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(235) trperiod(2003) xperiod(1990(1)2002) keep(synth_235, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(255) trperiod(2003) xperiod(1990(1)2002) keep(synth_255, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(325) trperiod(2003) xperiod(1990(1)2002) keep(synth_325, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(365) trperiod(2003) xperiod(1990(1)2002) keep(synth_365, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(490) trperiod(2003) xperiod(1990(1)2002) keep(synth_490, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(560) trperiod(2003) xperiod(1990(1)2002) keep(synth_560, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(640) trperiod(2003) xperiod(1990(1)2002) keep(synth_640, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(651) trperiod(2003) xperiod(1990(1)2002) keep(synth_651, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(740) trperiod(2003) xperiod(1990(1)2002) keep(synth_740, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(750) trperiod(2003) xperiod(1990(1)2002) keep(synth_750, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(770) trperiod(2003) xperiod(1990(1)2002) keep(synth_770, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(850) trperiod(2003) xperiod(1990(1)2002) keep(synth_850, replace)

qui synth emb gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity emb(2002) emb(1990), trunit(140) trperiod(2003) xperiod(1990(1)2002) keep(synth_140, replace)


**** STEP 2: predict effects ***


use synth_2, clear

rename _time years

gen tr_effect_2 = _Y_treated - _Y_synthetic

keep years tr_effect_2

drop if missing(years)

save synth_2, replace


use synth_20, clear

rename _time years

gen tr_effect_20 = _Y_treated - _Y_synthetic

keep years tr_effect_20

drop if missing(years)

save synth_20, replace



use synth_160, clear

rename _time years

gen tr_effect_160 = _Y_treated - _Y_synthetic

keep years tr_effect_160

drop if missing(years)

save synth_160, replace



use synth_235, clear

rename _time years

gen tr_effect_235 = _Y_treated - _Y_synthetic

keep years tr_effect_235

drop if missing(years)

save synth_235, replace



use synth_255, clear

rename _time years

gen tr_effect_255 = _Y_treated - _Y_synthetic

keep years tr_effect_255

drop if missing(years)

save synth_255, replace



use synth_325, clear

rename _time years

gen tr_effect_325 = _Y_treated - _Y_synthetic

keep years tr_effect_325

drop if missing(years)

save synth_325, replace



use synth_365, clear

rename _time years

gen tr_effect_365 = _Y_treated - _Y_synthetic

keep years tr_effect_365

drop if missing(years)

save synth_365, replace



use synth_490, clear

rename _time years

gen tr_effect_490 = _Y_treated - _Y_synthetic

keep years tr_effect_490

drop if missing(years)

save synth_490, replace



use synth_560, clear

rename _time years

gen tr_effect_560 = _Y_treated - _Y_synthetic

keep years tr_effect_560

drop if missing(years)

save synth_560, replace



use synth_651, clear

rename _time years

gen tr_effect_651 = _Y_treated - _Y_synthetic

keep years tr_effect_651

drop if missing(years)

save synth_651, replace



use synth_740, clear

rename _time years

gen tr_effect_740 = _Y_treated - _Y_synthetic

keep years tr_effect_740

drop if missing(years)

save synth_740, replace



use synth_750, clear

rename _time years

gen tr_effect_750 = _Y_treated - _Y_synthetic

keep years tr_effect_750

drop if missing(years)

save synth_750, replace


use synth_770, clear

rename _time years

gen tr_effect_770 = _Y_treated - _Y_synthetic

keep years tr_effect_770

drop if missing(years)

save synth_770, replace



use synth_850, clear

rename _time years

gen tr_effect_850 = _Y_treated - _Y_synthetic

keep years tr_effect_850

drop if missing(years)

save synth_850, replace



use synth_140, clear

rename _time years

gen tr_effect_140 = _Y_treated - _Y_synthetic

keep years tr_effect_140

drop if missing(years)

save synth_140, replace

**** STEP 3: merge all ***

use synth_2, clear
qui merge 1:1 years using synth_20, nogenerate
qui merge 1:1 years using synth_160, nogenerate
qui merge 1:1 years using synth_235, nogenerate
qui merge 1:1 years using synth_255, nogenerate
qui merge 1:1 years using synth_325, nogenerate
qui merge 1:1 years using synth_365, nogenerate
qui merge 1:1 years using synth_490, nogenerate
qui merge 1:1 years using synth_560, nogenerate
qui merge 1:1 years using synth_651, nogenerate
qui merge 1:1 years using synth_740, nogenerate
qui merge 1:1 years using synth_750, nogenerate
qui merge 1:1 years using synth_770, nogenerate
qui merge 1:1 years using synth_850, nogenerate
qui merge 1:1 years using synth_140, nogenerate

**** STEP 4: line ***



line tr_effect_2 tr_effect_20 tr_effect_235 tr_effect_255 tr_effect_325 tr_effect_365 tr_effect_490 tr_effect_560 tr_effect_651 tr_effect_740 tr_effect_750 tr_effect_770 tr_effect_850 tr_effect_140 years, lcolor(gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 black) xline(2002) ytitle("Excess Embassies")
 
 
 
 clear
 
 
************************************************
****** Brazilian PKOs Synth BRAZIL *************
************************************************

use MoM.dta

 ssc install synth, replace all  

xtset ccode year 


synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(140) trperiod(2003) xperiod(1990(1)2002) nested fig
 
 
 
 
************************************************
****** Brazilian PKOs Synth PLACEBOS ***********
************************************************

xtset ccode year 

**** STEP 1: predict all placebos ***************

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(2) trperiod(2003) xperiod(1990(1)2002) keep(synth_2, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(20) trperiod(2003) xperiod(1990(1)2002) keep(synth_20, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(160) trperiod(2003) xperiod(1990(1)2002) keep(synth_160, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(235) trperiod(2003) xperiod(1990(1)2002) keep(synth_235, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(255) trperiod(2003) xperiod(1990(1)2002) keep(synth_255, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(325) trperiod(2003) xperiod(1990(1)2002) keep(synth_325, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(365) trperiod(2003) xperiod(1990(1)2002) keep(synth_365, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(490) trperiod(2003) xperiod(1990(1)2002) keep(synth_490, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(560) trperiod(2003) xperiod(1990(1)2002) keep(synth_560, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(640) trperiod(2003) xperiod(1990(1)2002) keep(synth_640, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(651) trperiod(2003) xperiod(1990(1)2002) keep(synth_651, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(740) trperiod(2003) xperiod(1990(1)2002) keep(synth_740, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(750) trperiod(2003) xperiod(1990(1)2002) keep(synth_750, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(770) trperiod(2003) xperiod(1990(1)2002) keep(synth_770, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(850) trperiod(2003) xperiod(1990(1)2002) keep(synth_850, replace)

qui synth pko gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity pko(2002) pko(1990), trunit(140) trperiod(2003) xperiod(1990(1)2002) keep(synth_140, replace)


**** STEP 2: predict effects ***


use synth_2, clear

rename _time years

gen tr_effect_2 = _Y_treated - _Y_synthetic

keep years tr_effect_2

drop if missing(years)

save synth_2, replace


use synth_20, clear

rename _time years

gen tr_effect_20 = _Y_treated - _Y_synthetic

keep years tr_effect_20

drop if missing(years)

save synth_20, replace



use synth_160, clear

rename _time years

gen tr_effect_160 = _Y_treated - _Y_synthetic

keep years tr_effect_160

drop if missing(years)

save synth_160, replace



use synth_235, clear

rename _time years

gen tr_effect_235 = _Y_treated - _Y_synthetic

keep years tr_effect_235

drop if missing(years)

save synth_235, replace



use synth_255, clear

rename _time years

gen tr_effect_255 = _Y_treated - _Y_synthetic

keep years tr_effect_255

drop if missing(years)

save synth_255, replace



use synth_325, clear

rename _time years

gen tr_effect_325 = _Y_treated - _Y_synthetic

keep years tr_effect_325

drop if missing(years)

save synth_325, replace



use synth_365, clear

rename _time years

gen tr_effect_365 = _Y_treated - _Y_synthetic

keep years tr_effect_365

drop if missing(years)

save synth_365, replace



use synth_490, clear

rename _time years

gen tr_effect_490 = _Y_treated - _Y_synthetic

keep years tr_effect_490

drop if missing(years)

save synth_490, replace



use synth_560, clear

rename _time years

gen tr_effect_560 = _Y_treated - _Y_synthetic

keep years tr_effect_560

drop if missing(years)

save synth_560, replace



use synth_651, clear

rename _time years

gen tr_effect_651 = _Y_treated - _Y_synthetic

keep years tr_effect_651

drop if missing(years)

save synth_651, replace



use synth_740, clear

rename _time years

gen tr_effect_740 = _Y_treated - _Y_synthetic

keep years tr_effect_740

drop if missing(years)

save synth_740, replace



use synth_750, clear

rename _time years

gen tr_effect_750 = _Y_treated - _Y_synthetic

keep years tr_effect_750

drop if missing(years)

save synth_750, replace


use synth_770, clear

rename _time years

gen tr_effect_770 = _Y_treated - _Y_synthetic

keep years tr_effect_770

drop if missing(years)

save synth_770, replace



use synth_850, clear

rename _time years

gen tr_effect_850 = _Y_treated - _Y_synthetic

keep years tr_effect_850

drop if missing(years)

save synth_850, replace



use synth_140, clear

rename _time years

gen tr_effect_140 = _Y_treated - _Y_synthetic

keep years tr_effect_140

drop if missing(years)

save synth_140, replace


**** STEP 3: merge all ***

use synth_2, clear
qui merge 1:1 years using synth_20, nogenerate
qui merge 1:1 years using synth_160, nogenerate
qui merge 1:1 years using synth_235, nogenerate
qui merge 1:1 years using synth_255, nogenerate
qui merge 1:1 years using synth_325, nogenerate
qui merge 1:1 years using synth_365, nogenerate
qui merge 1:1 years using synth_490, nogenerate
qui merge 1:1 years using synth_560, nogenerate
qui merge 1:1 years using synth_651, nogenerate
qui merge 1:1 years using synth_740, nogenerate
qui merge 1:1 years using synth_750, nogenerate
qui merge 1:1 years using synth_770, nogenerate
qui merge 1:1 years using synth_850, nogenerate
qui merge 1:1 years using synth_140, nogenerate

**** STEP 4: line ***



line tr_effect_2 tr_effect_20 tr_effect_235 tr_effect_255 tr_effect_325 tr_effect_365 tr_effect_490 tr_effect_560 tr_effect_651 tr_effect_740 tr_effect_750 tr_effect_770 tr_effect_850 tr_effect_140 years, lcolor(gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 black) xline(2002)  ytitle("Excess PKOs")
 
 
 
 clear
  
 
************************************************
******* Brazilian IOs Synth BRAZIL *************
************************************************
 
use MoM.dta
 
ssc install synth, replace all  

xtset ccode year 

drop if year > 2014

synth io gdpgth gdp population landmass syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(140) trperiod(2003) xperiod(1990(1)2002) nested fig
 
 
 
************************************************
****** Brazilian IOs Synth PLACEBOS ******
************************************************

xtset ccode year 

**** STEP 1: predict all placebos ***************

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(2) trperiod(2003) xperiod(1990(1)2002) keep(synth_2, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(20) trperiod(2003) xperiod(1990(1)2002) keep(synth_20, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(160) trperiod(2003) xperiod(1990(1)2002) keep(synth_160, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(235) trperiod(2003) xperiod(1990(1)2002) keep(synth_235, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(255) trperiod(2003) xperiod(1990(1)2002) keep(synth_255, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(325) trperiod(2003) xperiod(1990(1)2002) keep(synth_325, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(365) trperiod(2003) xperiod(1990(1)2002) keep(synth_365, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(490) trperiod(2003) xperiod(1990(1)2002) keep(synth_490, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(560) trperiod(2003) xperiod(1990(1)2002) keep(synth_560, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(640) trperiod(2003) xperiod(1990(1)2002) keep(synth_640, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(651) trperiod(2003) xperiod(1990(1)2002) keep(synth_651, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(740) trperiod(2003) xperiod(1990(1)2002) keep(synth_740, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(750) trperiod(2003) xperiod(1990(1)2002) keep(synth_750, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(770) trperiod(2003) xperiod(1990(1)2002) keep(synth_770, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(850) trperiod(2003) xperiod(1990(1)2002) keep(synth_850, replace)

qui synth io gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity io(2002) io(1990), trunit(140) trperiod(2003) xperiod(1990(1)2002) keep(synth_140, replace)


**** STEP 2: predict effects ***


use synth_2, clear

rename _time years

gen tr_effect_2 = _Y_treated - _Y_synthetic

keep years tr_effect_2

drop if missing(years)

save synth_2, replace


use synth_20, clear

rename _time years

gen tr_effect_20 = _Y_treated - _Y_synthetic

keep years tr_effect_20

drop if missing(years)

save synth_20, replace



use synth_160, clear

rename _time years

gen tr_effect_160 = _Y_treated - _Y_synthetic

keep years tr_effect_160

drop if missing(years)

save synth_160, replace



use synth_235, clear

rename _time years

gen tr_effect_235 = _Y_treated - _Y_synthetic

keep years tr_effect_235

drop if missing(years)

save synth_235, replace



use synth_255, clear

rename _time years

gen tr_effect_255 = _Y_treated - _Y_synthetic

keep years tr_effect_255

drop if missing(years)

save synth_255, replace



use synth_325, clear

rename _time years

gen tr_effect_325 = _Y_treated - _Y_synthetic

keep years tr_effect_325

drop if missing(years)

save synth_325, replace



use synth_365, clear

rename _time years

gen tr_effect_365 = _Y_treated - _Y_synthetic

keep years tr_effect_365

drop if missing(years)

save synth_365, replace



use synth_490, clear

rename _time years

gen tr_effect_490 = _Y_treated - _Y_synthetic

keep years tr_effect_490

drop if missing(years)

save synth_490, replace



use synth_560, clear

rename _time years

gen tr_effect_560 = _Y_treated - _Y_synthetic

keep years tr_effect_560

drop if missing(years)

save synth_560, replace



use synth_651, clear

rename _time years

gen tr_effect_651 = _Y_treated - _Y_synthetic

keep years tr_effect_651

drop if missing(years)

save synth_651, replace



use synth_740, clear

rename _time years

gen tr_effect_740 = _Y_treated - _Y_synthetic

keep years tr_effect_740

drop if missing(years)

save synth_740, replace



use synth_750, clear

rename _time years

gen tr_effect_750 = _Y_treated - _Y_synthetic

keep years tr_effect_750

drop if missing(years)

save synth_750, replace


use synth_770, clear

rename _time years

gen tr_effect_770 = _Y_treated - _Y_synthetic

keep years tr_effect_770

drop if missing(years)

save synth_770, replace



use synth_850, clear

rename _time years

gen tr_effect_850 = _Y_treated - _Y_synthetic

keep years tr_effect_850

drop if missing(years)

save synth_850, replace



use synth_140, clear

rename _time years

gen tr_effect_140 = _Y_treated - _Y_synthetic

keep years tr_effect_140

drop if missing(years)

save synth_140, replace

**** STEP 3: merge all ***

use synth_2, clear
qui merge 1:1 years using synth_20, nogenerate
qui merge 1:1 years using synth_160, nogenerate
qui merge 1:1 years using synth_235, nogenerate
qui merge 1:1 years using synth_255, nogenerate
qui merge 1:1 years using synth_325, nogenerate
qui merge 1:1 years using synth_365, nogenerate
qui merge 1:1 years using synth_490, nogenerate
qui merge 1:1 years using synth_560, nogenerate
qui merge 1:1 years using synth_651, nogenerate
qui merge 1:1 years using synth_740, nogenerate
qui merge 1:1 years using synth_750, nogenerate
qui merge 1:1 years using synth_770, nogenerate
qui merge 1:1 years using synth_850, nogenerate
qui merge 1:1 years using synth_140, nogenerate

**** STEP 4: line ***



line tr_effect_2 tr_effect_20 tr_effect_235 tr_effect_255 tr_effect_325 tr_effect_365 tr_effect_490 tr_effect_560 tr_effect_651 tr_effect_740 tr_effect_750 tr_effect_770 tr_effect_850 tr_effect_140 years, lcolor(gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 black) xline(2002) ytitle("Excess IGOs")
 
 
 clear
 
 
 
 
 
************************************************
******* Brazilian AID Synth BRAZIL *************
************************************************
 
use MoM.dta
 
ssc install synth, replace all  

xtset ccode year 

drop if year > 2013

synth aidprojects gdpgth gdp population landmass syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(140) trperiod(2003) xperiod(1990(1)2002) nested fig

 

 
 
************************************************
********* Brazilian AID Synth PLACEBOS *********
************************************************

xtset ccode year 

**** STEP 1: predict all placebos ***************

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(2) trperiod(2003) xperiod(1990(1)2002) keep(synth_2, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(20) trperiod(2003) xperiod(1990(1)2002) keep(synth_20, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(160) trperiod(2003) xperiod(1990(1)2002) keep(synth_160, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(235) trperiod(2003) xperiod(1990(1)2002) keep(synth_235, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(255) trperiod(2003) xperiod(1990(1)2002) keep(synth_255, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(325) trperiod(2003) xperiod(1990(1)2002) keep(synth_325, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(365) trperiod(2003) xperiod(1990(1)2002) keep(synth_365, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(490) trperiod(2003) xperiod(1990(1)2002) keep(synth_490, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(560) trperiod(2003) xperiod(1990(1)2002) keep(synth_560, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(640) trperiod(2003) xperiod(1990(1)2002) keep(synth_640, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(651) trperiod(2003) xperiod(1990(1)2002) keep(synth_651, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(740) trperiod(2003) xperiod(1990(1)2002) keep(synth_740, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(750) trperiod(2003) xperiod(1990(1)2002) keep(synth_750, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(770) trperiod(2003) xperiod(1990(1)2002) keep(synth_770, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(850) trperiod(2003) xperiod(1990(1)2002) keep(synth_850, replace)

qui synth aidprojects gdpgth gdp population landmass  syst propor leg_majority ideology biodiversity aidprojects(2002) aidprojects(1990), trunit(140) trperiod(2003) xperiod(1990(1)2002) keep(synth_140, replace)


**** STEP 2: predict effects ***


use synth_2, clear

rename _time years

gen tr_effect_2 = _Y_treated - _Y_synthetic

keep years tr_effect_2

drop if missing(years)

save synth_2, replace


use synth_20, clear

rename _time years

gen tr_effect_20 = _Y_treated - _Y_synthetic

keep years tr_effect_20

drop if missing(years)

save synth_20, replace



use synth_160, clear

rename _time years

gen tr_effect_160 = _Y_treated - _Y_synthetic

keep years tr_effect_160

drop if missing(years)

save synth_160, replace



use synth_235, clear

rename _time years

gen tr_effect_235 = _Y_treated - _Y_synthetic

keep years tr_effect_235

drop if missing(years)

save synth_235, replace



use synth_255, clear

rename _time years

gen tr_effect_255 = _Y_treated - _Y_synthetic

keep years tr_effect_255

drop if missing(years)

save synth_255, replace



use synth_325, clear

rename _time years

gen tr_effect_325 = _Y_treated - _Y_synthetic

keep years tr_effect_325

drop if missing(years)

save synth_325, replace



use synth_365, clear

rename _time years

gen tr_effect_365 = _Y_treated - _Y_synthetic

keep years tr_effect_365

drop if missing(years)

save synth_365, replace



use synth_490, clear

rename _time years

gen tr_effect_490 = _Y_treated - _Y_synthetic

keep years tr_effect_490

drop if missing(years)

save synth_490, replace



use synth_560, clear

rename _time years

gen tr_effect_560 = _Y_treated - _Y_synthetic

keep years tr_effect_560

drop if missing(years)

save synth_560, replace



use synth_651, clear

rename _time years

gen tr_effect_651 = _Y_treated - _Y_synthetic

keep years tr_effect_651

drop if missing(years)

save synth_651, replace



use synth_740, clear

rename _time years

gen tr_effect_740 = _Y_treated - _Y_synthetic

keep years tr_effect_740

drop if missing(years)

save synth_740, replace



use synth_750, clear

rename _time years

gen tr_effect_750 = _Y_treated - _Y_synthetic

keep years tr_effect_750

drop if missing(years)

save synth_750, replace


use synth_770, clear

rename _time years

gen tr_effect_770 = _Y_treated - _Y_synthetic

keep years tr_effect_770

drop if missing(years)

save synth_770, replace



use synth_850, clear

rename _time years

gen tr_effect_850 = _Y_treated - _Y_synthetic

keep years tr_effect_850

drop if missing(years)

save synth_850, replace



use synth_140, clear

rename _time years

gen tr_effect_140 = _Y_treated - _Y_synthetic

keep years tr_effect_140

drop if missing(years)

save synth_140, replace

**** STEP 3: merge all ***

use synth_2, clear
qui merge 1:1 years using synth_20, nogenerate
qui merge 1:1 years using synth_160, nogenerate
qui merge 1:1 years using synth_235, nogenerate
qui merge 1:1 years using synth_255, nogenerate
qui merge 1:1 years using synth_325, nogenerate
qui merge 1:1 years using synth_365, nogenerate
qui merge 1:1 years using synth_490, nogenerate
qui merge 1:1 years using synth_560, nogenerate
qui merge 1:1 years using synth_651, nogenerate
qui merge 1:1 years using synth_740, nogenerate
qui merge 1:1 years using synth_750, nogenerate
qui merge 1:1 years using synth_770, nogenerate
qui merge 1:1 years using synth_850, nogenerate
qui merge 1:1 years using synth_140, nogenerate

**** STEP 4: line ***



line tr_effect_2 tr_effect_20 tr_effect_235 tr_effect_255 tr_effect_325 tr_effect_365 tr_effect_490 tr_effect_560 tr_effect_651 tr_effect_740 tr_effect_750 tr_effect_770 tr_effect_850 tr_effect_140 years, lcolor(gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 gs12 black) xline(2002) ytitle("Excess Aid Projects")
 
 
 clear
 
 
 
 
 
